package com.huateng.springcloud.controller;

import com.huateng.springcloud.po.TestFeignVo;
import com.huateng.springcloud.service.ITestFeignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;


/**
 * Test Feign Consumer Controller
 *
 * @author Evan
 * @create 2021/6/13 10:14
 */
@RestController
@Slf4j
public class TestFeignConsumerController implements ITestFeignService {

    @Value("${server.port}")
    private String port;

    @Override
    public String testFeignByGet() {
        return port;
    }

    @Override
    public TestFeignVo testFeignByPost(@RequestBody TestFeignVo testFeignVo) {
        log.info("port:", port);
        testFeignVo.setUserName(port);
        return testFeignVo;
    }

}
